/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.service.processor.edit;

import info.peigen.hotpot.common.service.base.processor.Processor;
import info.peigen.hotpot.common.service.base.processor.ProcessorServiceContext;
import info.peigen.hotpot.manage.core.domain.Position;
import info.peigen.hotpot.manage.core.service.order.PositionEditOrder;
import info.peigen.hotpot.manage.core.service.processor.AbstractHotpotManageServiceProcessor;
import info.peigen.hotpot.manage.core.util.convertor.PositionConvertor;
import org.noear.solon.annotation.Component;

/**
 * <b>(PositionEditProcessor)</b>
 * "职位" 编辑处理器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-06-28
 */
@SuppressWarnings({"rawtypes"})
@Component
public class PositionEditProcessor extends AbstractHotpotManageServiceProcessor implements Processor {
    @Override
    public Integer level() {
        return 25;
    }

    @Override
    public void execute(ProcessorServiceContext serviceContext) {
        PositionEditOrder order      = (PositionEditOrder) serviceContext.getOrder();
        Position          domain     = (Position) serviceContext.getDomain();
        Position          editDomain = PositionConvertor.INSTANCE.convertToDomain(order);
        editDomain.setId(domain.getId())
                .setPartnerId(domain.getPartnerId());
        serviceContext.setDomain(domain);
    }

}